package cn.edu.seu.ssny.service.impl;

import cn.edu.seu.ssny.dao.IStatisticsPowercostRateTypeDao;
import cn.edu.seu.ssny.dao.support.IBaseDao;
import cn.edu.seu.ssny.entity.Project;
import cn.edu.seu.ssny.entity.StatisticsPowercostRateType;
import cn.edu.seu.ssny.service.IStatisticsPowercostRateTypeService;
import cn.edu.seu.ssny.service.support.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class StatisticsPowercostRateTypeServiceImpl extends BaseServiceImpl<StatisticsPowercostRateType, Integer> implements IStatisticsPowercostRateTypeService {

    @Autowired
    private IStatisticsPowercostRateTypeDao statisticsPowercostRateTypeDao;

    @Override
    public IBaseDao<StatisticsPowercostRateType, Integer> getBaseDao() {
        return statisticsPowercostRateTypeDao;
    }

    @Override
    public StatisticsPowercostRateType findByProjectAndName(Project project, String name) {
        return statisticsPowercostRateTypeDao.findStatisticsPowercostRateTypeByProjectAndName(project, name);
    }

    @Override
    public List<StatisticsPowercostRateType> findByProject(Project project) {
        return statisticsPowercostRateTypeDao.findStatisticsPowercostRateTypeByProjectOrderByName(project);
    }
}
